<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Function template set_intersection</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.Compute">
<link rel="up" href="../../boost_compute/reference.html#header.boost.compute.algorithm.set_intersection_hpp" title="Header &lt;boost/compute/algorithm/set_intersection.hpp&gt;">
<link rel="prev" href="set_difference.html" title="Function template set_difference">
<link rel="next" href="set_symmetric_difference.html" title="Function template set_symmetric_difference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="set_difference.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.algorithm.set_intersection_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="set_symmetric_difference.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.compute.set_intersection"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Function template set_intersection</span></h2>
<p>boost::compute::set_intersection — Set intersection algorithm. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../boost_compute/reference.html#header.boost.compute.algorithm.set_intersection_hpp" title="Header &lt;boost/compute/algorithm/set_intersection.hpp&gt;">boost/compute/algorithm/set_intersection.hpp</a>&gt;

</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> InputIterator1<span class="special">,</span> <span class="keyword">typename</span> InputIterator2<span class="special">,</span> 
         <span class="keyword">typename</span> OutputIterator<span class="special">&gt;</span> 
  <span class="identifier">OutputIterator</span> 
  <span class="identifier">set_intersection</span><span class="special">(</span><span class="identifier">InputIterator1</span> first1<span class="special">,</span> <span class="identifier">InputIterator1</span> last1<span class="special">,</span> 
                   <span class="identifier">InputIterator2</span> first2<span class="special">,</span> <span class="identifier">InputIterator2</span> last2<span class="special">,</span> 
                   <span class="identifier">OutputIterator</span> result<span class="special">,</span> 
                   <span class="identifier">command_queue</span> <span class="special">&amp;</span> queue <span class="special">=</span> <span class="identifier">system</span><span class="special">::</span><span class="identifier">default_queue</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm46604984674512"></a><h2>Description</h2>
<p>Finds the intersection of the sorted range [first1, last1) with the sorted range [first2, last2) and stores it in range starting at result 

Space complexity: \Omega(2(distance(<code class="computeroutput">first1</code>, <code class="computeroutput">last1</code>) + distance(<code class="computeroutput">first2</code>, <code class="computeroutput">last2</code>))) </p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">first1</code></span></p></td>
<td><p>Iterator pointing to start of first set </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">first2</code></span></p></td>
<td><p>Iterator pointing to start of second set </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">last1</code></span></p></td>
<td><p>Iterator pointing to end of first set </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">last2</code></span></p></td>
<td><p>Iterator pointing to end of second set </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">queue</code></span></p></td>
<td><p>Queue on which to execute</p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">result</code></span></p></td>
<td><p>Iterator pointing to start of range in which the intersection will be stored </p></td>
</tr>
</tbody>
</table></div></td>
</tr>
<tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>Iterator pointing to end of intersection</p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2013, 2014 Kyle Lutz<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="set_difference.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../boost_compute/reference.html#header.boost.compute.algorithm.set_intersection_hpp"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="set_symmetric_difference.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
